﻿package com.janisRadins.asDraw {
	import com.janisRadins.asDraw.vo.CurveData;
	/**
	 * ...
	 * @author Jānis Radiņš
	 */
	public interface IPathCollection {
		/**
		 * Paths count in collection
		 */
		function get pathCount():uint
		/**
		 * Current index of iterator
		 */
		function get pathIndex():uint
		/**
		 * Method which returns path instance at some index
		 * @param	index
		 * @return 	Path
		 */
		function getPathAt(index:int):Path
		/**
		 * Adds Path to collection and returns new collection length
		 * @param	paths Path instances to be added
		 * @return	New collection length
		 */
		function push(... paths):uint
		/**
		 * Method that adds Path to collection at specific index
		 * @param	path Path instance to be added
		 * @param	index Value in range -pathCount to pathCount which specify at which 
		 * 			index Path should be added
		 */
		function setPathAt(path:Path, index:int):void
		/**
		 * Method that change Path position in collection
		 * @param	oldIndex Index of path which should be moved
		 * @param	newIndex Value in range -pathCount to pathCount which specify to which 
		 * 			index Path should be moved to
		 */
		function changePathIndex(oldIndex:int, newIndex:int):void
		/**
		 * Method that removes all specific Path instances from collection
		 * @param	path Reference to Path instance in collection that should be removed
		 * @return Path that has been removed
		 */
		function removePath(path:Path):Path
		/**
		 * Method that removes Path from collection by index
		 * @param	index Value in range -pathCount to pathCount which specify at which index 
		 * 			Path should be removed
		 * @return Path that has been removed
		 */
		function removePathAt(index:int):Path
		/**
		 * Method that returns flag on wether Curve is contained by collection
		 * @param	curve Curve that should be checked
		 * @return Boolean flag, true if Curve is inside collection or false if not
		 */
		function contains(path:Path):Boolean
		/**
		 * Method that returns data about Path position inside collection
		 * @param	path
		 * @return	PathData
		 */
		function getPathData(path:Path):CurveData
		/**
		 * Method that returns flag whether theres more paths to fetch beyond <code>pathIndex</code>
		 * @return Boolean
		 */
		function get hasNext():Boolean
		/**
		 * Method that returns next Path instance
		 * @return Path
		 */
		function getNext():Path
		/**
		 * Method that returns flag whether theres more paths to fetch before <code>pathIndex</code>
		 * @return Boolean
		 */
		function get hasPrev():Boolean
		/**
		 * Method that returns previous Path instance
		 * @return Path
		 */
		function getPrev():Path
		/**
		 * Method that resets pathIndex to begining of path collection
		 */
		function resetToStart():void
		/**
		 * Method that sets pathIndex to end of path collection
		 */
		function resetToEnd():void
	}
}